package com.qut.qut_01.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

//表示该类是操作数据库的类
//自动创建对象
@Mapper
public interface UserMapper {

    @Insert("insert into written"+
            "(title,date,content,cover)"+
            " values(#{title},#{date},#{content},#{cover})")
    int keep(Map<String,String> param);

    List<Map<String,Object>> search_1(Map<String,Object> param);

    @Update("update written" +
            " set title=#{title}," +
            " content=#{content}," +
            " date=#{date}" +
            " where id=#{id}")
    int update(Map<String,String> param);

    int batchDelete(String[] ids);
}